<?php

/**
 * Reservaciones form base class.
 *
 * @method Reservaciones getObject() Returns the current form's model object
 *
 * @package    SistemaRutasEc
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 29553 2010-05-20 14:33:00Z Kris.Wallsmith $
 */
abstract class BaseReservacionesForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'id_re'      => new sfWidgetFormInputHidden(),
      'id_tu'      => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Turno'), 'add_empty' => false)),
      'dni'        => new sfWidgetFormInputText(),
      'estado'     => new sfWidgetFormInputCheckbox(),
      'confirmado' => new sfWidgetFormInputCheckbox(),
    ));

    $this->setValidators(array(
      'id_re'      => new sfValidatorChoice(array('choices' => array($this->getObject()->get('id_re')), 'empty_value' => $this->getObject()->get('id_re'), 'required' => false)),
      'id_tu'      => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('Turno'))),
      'dni'        => new sfValidatorInteger(),
      'estado'     => new sfValidatorBoolean(array('required' => false)),
      'confirmado' => new sfValidatorBoolean(array('required' => false)),
    ));

    $this->widgetSchema->setNameFormat('reservaciones[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'Reservaciones';
  }

}
